package com.atguigu.gulimall.product.feign.fallback;

import com.atguigu.common.exception.BizCodeEnum;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.product.feign.SeckillFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @create: 2024/9/16
 * @author: gyhe10
 * @description:
 **/

@Slf4j
@Component
public class SeckillFeignServiceFallback implements SeckillFeignService {
    @Override
    public R getSkuSeckillInfo(Long skuId) {
        log.error("远程调用 seckill 服务，查询商品是否参与秒杀优惠失败，涉及商品 ID：{}", skuId);
        return R.error(BizCodeEnum.CALL_OTHER_SERVICE_EXCEPTION.getCode(), "远程调用 seckill 服务，查询商品是否参与秒杀优惠失败，涉及商品 ID：" + skuId);
    }
}
